package server.template;

/**
 * @author swzhang
 * @version v1.0
 * @date 2021-11-19 10:08
 */
public abstract class LifecycleAbstract implements Lifecycle {

    protected abstract void initInternal();

    @Override
    public void init() {
        System.out.println(this.getClass().getName()+"  init begin");
        initInternal();
        System.out.println(this.getClass().getName()+"  init finished");
    }

    @Override
    public void start() {
        System.out.println(this.getClass().getName()+"  start begin");
        startInternal();
        System.out.println(this.getClass().getName()+"  start finished");
    }

    protected abstract void startInternal();
}
